package bancosys.tec.services.implementor.type;

import java.util.List;
import java.util.Map;

import jmine.tec.di.annotation.Injected;
import jmine.tec.services.annotations.Execution;
import jmine.tec.services.annotations.Input;
import jmine.tec.services.annotations.ServiceImplementor;
import jmine.tec.services.annotations.WithRegex;
import jmine.tec.services.api.ActionsEnum;
import bancosys.tec.services.implementor.descriptor.InstanceCreatorDescriberTest;

@ServiceImplementor(action = ActionsEnum.ALTERAR)
public final class SubSubType extends FixedSub {
    public SubSubType(@Injected List<Object> list, @Input(fieldName = "instance") Object instance,
            @WithRegex(regex = ".+") Map<String, Object> map) {
        assertEquals(1, list.size());
        assertEquals("instance", instance);
        assertFalse(map.isEmpty());
    }

    @Execution
    public void executeSimple(@Injected List<Object> list, @Input(fieldName = "instance") Object instance) {
        assertEquals(1, list.size());
        assertEquals("instance", instance);
        assertSame(list.get(0), InstanceCreatorDescriberTest.STATIC);
        this.setExecuted();
    }

}
